﻿using SLClient.ServiceAPI;
using System;
using System.Diagnostics;
using System.Threading;
using System.Windows;
using System.Windows.Controls;

namespace SLClient.CustomerControls
{
    public partial class ConfirmWindow : ChildWindow
    {
        private EventHandler _BetSuccess;
        public event EventHandler BetSuccess
        {
            add
            {
                EventHandler handler2;
                EventHandler betSuccess = this._BetSuccess;
                do
                {
                    handler2 = betSuccess;
                    EventHandler handler3 = (EventHandler)Delegate.Combine(handler2, value);
                    betSuccess = Interlocked.CompareExchange<EventHandler>(ref this._BetSuccess, handler3, handler2);
                }
                while (betSuccess != handler2);
            }
            remove
            {
                EventHandler handler2;
                EventHandler betSuccess = this._BetSuccess;
                do
                {
                    handler2 = betSuccess;
                    EventHandler handler3 = (EventHandler)Delegate.Remove(handler2, value);
                    betSuccess = Interlocked.CompareExchange<EventHandler>(ref this._BetSuccess, handler3, handler2);
                }
                while (betSuccess != handler2);
            }
        }

        public ConfirmWindow(BetControl betControl, BetControlNx betControlNx, UserPlayInfo userPlayInfo, string betName)
        {
            this.InitializeComponent();
            base.DataContext=new ConfirmWindowViewModel(betControl, betControlNx, this, userPlayInfo, betName);
        }

        private void btClose_Click(object sender, RoutedEventArgs e)
        {
            base.DialogResult = true;
        }

        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            base.DialogResult = false;
        }
    }
}

